/**
 * 
 */
package com.vcaresolution.logistic.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import com.vcaresolution.logistic.pojo.Businessprocess;
import com.vcaresolution.logistic.to.BusinessProcessTO;

/**
 * The <code>ExportServiceImpl</code> provides implementation methods for
 * managing Export related functionality Like WebServiceProcess in <b>LEADER</b> application.
 *
 * @author Kushal Shah
 * @version 1.0
 * @since ShipSoft 1.0
 * @see ExportService
 * @category Service
 */
@Service
public class ExportServiceImpl extends BaseService implements ExportService{
	
	/* (non-Javadoc)
	 * @see web.clerk.webapp.leader.service.ExportService#getWebServiceProcesses()
	 */
	@Override
	public List<BusinessProcessTO> getBusinessProcesses() {
		
		List<Businessprocess> businessProcesses = getDaoFactory().getExportDAO().getBusinessProcesses();
		
		List<BusinessProcessTO> businessProcessList = new ArrayList<BusinessProcessTO>();
		
		if( businessProcesses != null && !businessProcesses.isEmpty() ){
			
			BusinessProcessTO businessProcessTO = null;
			for(Businessprocess businessprocess: businessProcesses){
				businessProcessTO = new BusinessProcessTO();
				
				BeanUtils.copyProperties(businessprocess, businessProcessTO);
				
				businessProcessList.add(businessProcessTO);
			}
		}
		
		return businessProcessList;
	}


}
